package guava;

import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.ClassPath;
import org.junit.Test;

import java.io.IOException;

/**
 * @author xukai
 * @desc
 * @date 2017-04-06-18:53
 */
public class ReflectUtil {


    @Test
    public void testClassPath() throws IOException {
        ClassPath classpath = ClassPath.from(this.getClass().getClassLoader()); // scans the class path used by classloader
        ImmutableSet<ClassPath.ClassInfo> classes = classpath.getTopLevelClasses("org.xukai.common");
        System.out.println(classes.size());
        for (ClassPath.ClassInfo classInfo : classes){
            Class<?> load = classInfo.load();
        }
    }

}
